package com.swt.gap.dao;

import com.github.pagehelper.Page;
import com.swt.gap.model.dto.SubscribeFileDTO;
import com.swt.gap.model.entity.TaskSubscribeData;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;


@Repository
public interface TaskSubscribeDataDao {
    int deleteByPrimaryKey(Integer subscribeId);

    int insertSelective(TaskSubscribeData record);

    TaskSubscribeData selectByPrimaryKey(Integer subscribeId);

    int updateByPrimaryKeySelective(TaskSubscribeData record);

    Page<TaskSubscribeData> selectByTaskIdAndStatus(@Param("taskId")Integer taskId,
                                                    @Param("status")Integer status);

    Page<SubscribeFileDTO> selectByTaskIdAndStatusAndFileName(@Param("taskId")Integer taskId,
                                                              @Param("status")Integer status,
                                                              @Param("fileName")String fileName);

    Integer updateStatusReed(Integer[] subscribeId);

    Integer updateStatusByTaskIdAndFileId(@Param("taskId")Integer taskId,
                                          @Param("fileId")Integer fileId,
                                          @Param("status")Integer status);

}